// Button sizes
@mixin button-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
  padding: $padding-y $padding-x;
  font-size: $font-size;
  line-height: $line-height;
  // Manually declare to provide an override to the browser default
  @if $enable-rounded {
    border-radius: $border-radius;
  } @else {
    border-radius: 0;
  }
}

//生成 btn
@mixin build-button-variant($background, $border, $hover-background: darken($background, 8%), $hover-border: darken($border, 5%), $active-background: darken($background, 20%), $active-border: darken($border, 20%)) {
  //根据颜色亮度决定文字是深色还是浅色
  color: color-yiq($background);
  @include gradient-bg($background);
  border-color: $border;
  @include box-shadow($btn-box-shadow);

  // Disabled comes first so active can properly restyle
  &.disabled,
  &:disabled {
    color: $btn-disabled-color;
    border-color: $background;
    background-color: $background;
    cursor: not-allowed;
  }


  @include hover {
    &:not(.disabled):not(:disabled){
      color: color-yiq($hover-background);
      @include gradient-bg($hover-background);
      border-color: $hover-border;
    }

  }

  &:not(:disabled):not(.disabled):active,
  &:not(:disabled):not(.disabled).active,
  .show > &.dropdown-toggle {
    color: color-yiq($active-background);
    background-color: $active-background;
    @if $enable-gradients {
      @include gradient-bg($active-background);
    }
    border-color: $active-border;
  }
}

@mixin build-outline-button-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) {
  color: $color;
  background-color: transparent;
  background-image: none;
  border-color: $color;

  &:hover:not(.disabled):not(:disabled){
    color: $color-hover;
    background-color: $active-background;
    border-color: $active-border;
  }

  &.disabled,
  &:disabled {
    color: $outbtn-disabled-color;
    border-color:$outbtn-disabled-bcolor;
    background-color: $outbtn-disabled-bg;
    cursor: not-allowed;
  }

  &:not(:disabled):not(.disabled):active,
  &:not(:disabled):not(.disabled).active,
  .show > &.dropdown-toggle {
    color: color-yiq($active-background);
    background-color: $active-background;
    border-color: $active-border;
  }
}